﻿#if UNITY_EDITOR
using System;
using System.Collections.Generic;
/// <summary>
/// 编辑器收集资源【DisplayProgressBar】
/// </summary>
public partial class ESF_Utility
{
    #region Collect 收集资源
    #region 无参数
    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> Collect<T>(Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(new string[1] { globalAssetsFolderName }, enESF_AssetFilterClassify.None, enESF_AssetClassify.All, enESF_DependencyClassify.UnClude, null, null, _displayProgressBar);
    }
    #endregion

    #region 一参数
    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> Collect<T>(string[] _searchInFolders, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, enESF_AssetFilterClassify.None, enESF_AssetClassify.All, enESF_DependencyClassify.UnClude, null, null, _displayProgressBar);
    }
    #endregion

    #region 二参数
    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_filter">过滤</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> Collect<T>(string[] _searchInFolders,
        enESF_AssetFilterClassify _filter, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, _filter, enESF_AssetClassify.All, enESF_DependencyClassify.UnClude, null, null, _displayProgressBar);
    }

    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_filter">过滤</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> Collect<T>(string[] _searchInFolders,
        string _filter, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, _filter, enESF_AssetClassify.All, enESF_DependencyClassify.UnClude, null, null, _displayProgressBar);
    }
    #endregion

    #region 三参数
    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_filter">过滤</param>
    /// <param name="_assetClassify">资源分类</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> Collect<T>(string[] _searchInFolders,
        enESF_AssetFilterClassify _filter, enESF_AssetClassify _assetClassify, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, _filter, _assetClassify, enESF_DependencyClassify.UnClude, null, null, _displayProgressBar);
    }

    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_filter">过滤</param>
    /// <param name="_assetClassify">资源分类</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> Collect<T>(string[] _searchInFolders,
        string _filter, enESF_AssetClassify _assetClassify, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, _filter, _assetClassify, enESF_DependencyClassify.UnClude, null, null, _displayProgressBar);
    }
    #endregion

    #region 四参数
    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_filter">过滤</param>
    /// <param name="_assetClassify">资源分类</param>
    /// <param name="_dependencyClassify">依赖项分类</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> Collect<T>(string[] _searchInFolders,
        enESF_AssetFilterClassify _filter, enESF_AssetClassify _assetClassify, enESF_DependencyClassify _dependencyClassify, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, _filter, _assetClassify, _dependencyClassify, null, null, _displayProgressBar);
    }

    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_filter">过滤</param>
    /// <param name="_assetClassify">资源分类</param>
    /// <param name="_dependencyClassify">依赖项分类</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> Collect<T>(string[] _searchInFolders,
        string _filter, enESF_AssetClassify _assetClassify, enESF_DependencyClassify _dependencyClassify, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, _filter, _assetClassify, _dependencyClassify, null, null, _displayProgressBar);
    }
    #endregion

    #region 五参数
    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_filter">过滤</param>
    /// <param name="_assetClassify">资源分类</param>
    /// <param name="_dependencyClassify">依赖项分类</param>
    /// <param name="_funIslegal">是否合法回调</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> Collect<T>(string[] _searchInFolders,
        enESF_AssetFilterClassify _filter, enESF_AssetClassify _assetClassify, enESF_DependencyClassify _dependencyClassify,
        Func<T, bool> _funIslegal, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, _filter, _assetClassify, _dependencyClassify, _funIslegal, null, _displayProgressBar);
    }

    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_filter">过滤</param>
    /// <param name="_assetClassify">资源分类</param>
    /// <param name="_dependencyClassify">依赖项分类</param>
    /// <param name="_funIslegal">是否合法回调</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> Collect<T>(string[] _searchInFolders,
        string _filter, enESF_AssetClassify _assetClassify, enESF_DependencyClassify _dependencyClassify,
        Func<T, bool> _funIslegal, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, _filter, _assetClassify, _dependencyClassify, _funIslegal, null, _displayProgressBar);
    }
    #endregion

    #region 六参数
    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_filter">过滤</param>
    /// <param name="_assetClassify">资源分类</param>
    /// <param name="_dependencyClassify">依赖项分类</param>
    /// <param name="_funIslegal">是否合法回调</param>
    /// <param name="_funIsForceExclude">是否强制排除回调</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> Collect<T>(string[] _searchInFolders,
        enESF_AssetFilterClassify _filter, enESF_AssetClassify _assetClassify, enESF_DependencyClassify _dependencyClassify,
        Func<T, bool> _funIslegal, Func<T, bool> _funIsForceExclude, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, OnTransFilter(_filter), _assetClassify, _dependencyClassify, _funIslegal, _funIsForceExclude, _displayProgressBar);
    }

    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_filter">过滤</param>
    /// <param name="_assetClassify">资源分类</param>
    /// <param name="_dependencyClassify">依赖项分类</param>
    /// <param name="_funIslegal">是否合法回调</param>
    /// <param name="_funIsForceExclude">是否强制排除回调</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> Collect<T>(string[] _searchInFolders,
        string _filter, enESF_AssetClassify _assetClassify, enESF_DependencyClassify _dependencyClassify,
        Func<T, bool> _funIslegal, Func<T, bool> _funIsForceExclude, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(OnCreateCollectAssetArgument<T>(_searchInFolders, _filter, _assetClassify, _dependencyClassify, _funIslegal, _funIsForceExclude, enESF_DisplayProgressBarClassify.Normal, _displayProgressBar, null));
    }
    #endregion
    #endregion

    #region CollectFile 收集文件
    #region 无参数
    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> CollectFile<T>(Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(new string[1] { globalAssetsFolderName }, enESF_AssetFilterClassify.None, enESF_AssetClassify.File, enESF_DependencyClassify.UnClude, null, null, _displayProgressBar);
    }
    #endregion

    #region 一参数
    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> CollectFile<T>(string[] _searchInFolders, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, enESF_AssetFilterClassify.None, enESF_AssetClassify.File, enESF_DependencyClassify.UnClude, null, null, _displayProgressBar);
    }
    #endregion

    #region 二参数
    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_filter">过滤</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> CollectFile<T>(string[] _searchInFolders,
        enESF_AssetFilterClassify _filter, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, _filter, enESF_AssetClassify.File, enESF_DependencyClassify.UnClude, null, null, _displayProgressBar);
    }

    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_filter">过滤</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> CollectFile<T>(string[] _searchInFolders,
        string _filter, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, _filter, enESF_AssetClassify.File, enESF_DependencyClassify.UnClude, null, null, _displayProgressBar);
    }
    #endregion

    #region 三参数
    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_filter">过滤</param>
    /// <param name="_dependencyClassify">依赖项分类</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> CollectFile<T>(string[] _searchInFolders,
        enESF_AssetFilterClassify _filter, enESF_DependencyClassify _dependencyClassify, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, _filter, enESF_AssetClassify.File, _dependencyClassify, null, null, _displayProgressBar);
    }

    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_filter">过滤</param>
    /// <param name="_dependencyClassify">依赖项分类</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> CollectFile<T>(string[] _searchInFolders,
        string _filter, enESF_DependencyClassify _dependencyClassify, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, _filter, enESF_AssetClassify.File, _dependencyClassify, null, null, _displayProgressBar);
    }
    #endregion

    #region 四参数
    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_filter">过滤</param>
    /// <param name="_dependencyClassify">依赖项分类</param>
    /// <param name="_funIslegal">是否合法回调</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> CollectFile<T>(string[] _searchInFolders,
        enESF_AssetFilterClassify _filter, enESF_DependencyClassify _dependencyClassify,
        Func<T, bool> _funIslegal, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, _filter, enESF_AssetClassify.File, _dependencyClassify, _funIslegal, null, _displayProgressBar);
    }

    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_filter">过滤</param>
    /// <param name="_dependencyClassify">依赖项分类</param>
    /// <param name="_funIslegal">是否合法回调</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> CollectFile<T>(string[] _searchInFolders,
        string _filter,enESF_DependencyClassify _dependencyClassify,
        Func<T, bool> _funIslegal, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, _filter, enESF_AssetClassify.File, _dependencyClassify, _funIslegal, null, _displayProgressBar);
    }
    #endregion

    #region 五参数
    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_filter">过滤</param>
    /// <param name="_dependencyClassify">依赖项分类</param>
    /// <param name="_funIslegal">是否合法回调</param>
    /// <param name="_funIsForceExclude">是否强制排除回调</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> CollectFile<T>(string[] _searchInFolders,
        enESF_AssetFilterClassify _filter,enESF_DependencyClassify _dependencyClassify,
        Func<T, bool> _funIslegal, Func<T, bool> _funIsForceExclude, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, _filter, enESF_AssetClassify.File, _dependencyClassify, _funIslegal, _funIsForceExclude, _displayProgressBar);
    }

    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_filter">过滤</param>
    /// <param name="_dependencyClassify">依赖项分类</param>
    /// <param name="_funIslegal">是否合法回调</param>
    /// <param name="_funIsForceExclude">是否强制排除回调</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> CollectFile<T>(string[] _searchInFolders,
        string _filter, enESF_DependencyClassify _dependencyClassify,
        Func<T, bool> _funIslegal, Func<T, bool> _funIsForceExclude, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, _filter, enESF_AssetClassify.File, _dependencyClassify, _funIslegal, _funIsForceExclude, _displayProgressBar);
    }
    #endregion
    #endregion

    #region CollectFolder 收集文件夹

    #region 无参数
    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> CollectFolder<T>(Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(new string[1] { globalAssetsFolderName }, enESF_AssetFilterClassify.None, enESF_AssetClassify.Folder, enESF_DependencyClassify.UnClude, null, null, _displayProgressBar);
    }
    #endregion

    #region 一参数
    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> CollectFolder<T>(string[] _searchInFolders, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, enESF_AssetFilterClassify.None, enESF_AssetClassify.Folder, enESF_DependencyClassify.UnClude, null, null, _displayProgressBar);
    }
    #endregion

    #region 二参数
    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_dependencyClassify">依赖项分类</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> CollectFolder<T>(string[] _searchInFolders,enESF_DependencyClassify _dependencyClassify, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, enESF_AssetFilterClassify.None, enESF_AssetClassify.Folder, _dependencyClassify, null, null, _displayProgressBar);
    }
    #endregion

    #region 三参数
    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_dependencyClassify">依赖项分类</param>
    /// <param name="_funIslegal">是否合法回调</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> CollectFolder<T>(string[] _searchInFolders, enESF_DependencyClassify _dependencyClassify,
        Func<T, bool> _funIslegal, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, enESF_AssetFilterClassify.None, enESF_AssetClassify.Folder, _dependencyClassify, _funIslegal, null, _displayProgressBar);
    }
    #endregion

    #region 四参数
    /// <summary>
    /// 创建收集资源参数
    /// </summary>
    /// <typeparam name="T">资源节点</typeparam>
    /// <param name="_searchInFolders">搜索目录</param>
    /// <param name="_dependencyClassify">依赖项分类</param>
    /// <param name="_funIslegal">是否合法回调</param>
    /// <param name="_funIsForceExclude">是否强制排除回调</param>
    /// <param name="_displayProgressBar">显示进度条回调</param>
    /// <returns>参数</returns>
    public static List<T> CollectFolder<T>(string[] _searchInFolders, enESF_DependencyClassify _dependencyClassify,
        Func<T, bool> _funIslegal, Func<T, bool> _funIsForceExclude, Action<T, int, int> _displayProgressBar)
        where T : AbsESF_EditorCollectAsset
    {
        return Collect<T>(_searchInFolders, enESF_AssetFilterClassify.None, enESF_AssetClassify.Folder, _dependencyClassify, _funIslegal, _funIsForceExclude, _displayProgressBar);
    }
    #endregion
    #endregion
}
#endif
